// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 2009-10-26 21:59:38


// Source File Name:   WIDE.java

package com.vhly.classfile.bytecode;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

// Referenced classes of package com.vhly.classfile.bytecode:
//            BaseCode

public class WIDE
        implements BaseCode {

    private int length;
    private int tag;
    private int index;
    private int constvalue;
    private int offset;

    public WIDE() {
    }

    public String getName() {
        return "WIDE";
    }

    public int getOp() {
        return 196;
    }

    public int length() {
        return length;
    }

    public void read(DataInputStream din)
            throws IOException {
        tag = din.read();
        if (tag != 132) {
            length = 4;
            index = din.readUnsignedShort();
        } else {
            length = 6;
            index = din.readUnsignedShort();
            constvalue = din.readShort();
        }
    }

    public void write(DataOutputStream dout)
            throws IOException {
        dout.write(196);
        dout.write(tag);
        if (tag != 132) {
            dout.writeShort(index);
        } else {
            dout.writeShort(index);
            dout.writeShort(constvalue);
        }
    }

    public int getOffset() {
        return offset;
    }

    public String getDescrption() {
        String ret = "";
        return ret;
    }

    public int getOperation() {
        return tag;
    }

    public void setOperation(int operation) {
        tag = operation;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int indexShort) {
        index = indexShort;
    }

    public int getConst() {
        return constvalue;
    }

    public void setConst(int cv) {
        constvalue = cv;
    }

    public void setOffset(int off) {
        offset = off;
    }
}